Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

226
Vistas
Post Request rejected with "Missing body content" error during Fetch

I am sending a Post request, with JavaScript Fetch method. The post attempts to create a Microsoft Teams chat message, via the Microsoft Graph Teams API. However, the server rejects the post request, with the message "missing body content". The payload shows the message body is being sent (Please see screenshot). It appears that the server is rejecting my Post request because it can not parse the body, which is in json format. Can anyone advise how I fix this Fetch issue? I've attached a code snippet for your review.

const data = {content: 'Hello Word'};
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer '+response.accessToken,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(data),
};

fetch(endpoint, options)
    .then((response)=>{
      const data = response.json();
      console.log("RESPONSE1:", data);
      return data;
    })
    .then((data)=>{
      console.log("RESPONSE2:", data);
      callback(data, endpoint);
    })
    .catch((error) => console.log("PUSHMSGRAPH-Error:", error));

Post Request

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try using the API and post it from the reference page with this API

POST /teams/{team-id}/channels/{channel-id}/messages

const teamId = '5834e4c1-2897-4cc3-b21900b56';
const threadid = '19:1df3a1d...@thread.tacv2';

const options = {
  authProvider,
};

const client = Client.init(options);

const chatMessage = {
  body: {
    content: 'Hello World'
  }
};


await client.api('/teams/' + teamId + '/channels/' + threadid + '/messages')
  .post(chatMessage);

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda